package nl.vddijssel.social.login.client.activity;

import nl.vddijssel.social.client.ClientFactory;
import nl.vddijssel.social.client.place.InitPlace;
import nl.vddijssel.social.login.client.LoginFactory;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

public class LoginActivityMapper implements ActivityMapper {
	
	private ClientFactory clientFactory;
	private LoginFactory loginFactory;
	
	public LoginActivityMapper(ClientFactory clientFactory,LoginFactory loginFactory){
		this.clientFactory = clientFactory;
		this.loginFactory = loginFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if(place instanceof InitPlace){
			return new LoginInitActivity((InitPlace)place,clientFactory,loginFactory);
		}
		return null;
	}

}
